feat: Phase 1A system observability and diagnostics#39
Merged
Conversation
Track total/per-type/dropped/no-consumer message counts in gateway dispatch loop. Expose via gateway_get_stats() for shell diagnostics and heartbeat health reporting. Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
New OSAL API: claw_log_set_level() / claw_log_get_level() with per-platform implementation. Messages above the configured level are silently dropped. ESP-IDF backend also calls esp_log_level_set() for consistent filtering. Shell /log command extended: /log level <error|warn|info|debug> to adjust verbosity at runtime without reboot. Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
Add largest contiguous free block and fragmentation percentage to the ESP-IDF memory_info tool output. Fragmentation is calculated as (1 - largest_block / free_total) * 100%. Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
Before the LLM ping, check_device_health() samples heap usage from the platform API. When usage exceeds 80%, a memory warning event is posted to the heartbeat buffer, which triggers an AI summary on the next tick. Platform-aware: ESP-IDF uses heap_caps API, RT-Thread uses rt_memory_info(). Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
architecture.md (en/zh): - Gateway: document dispatch statistics API - Heartbeat: describe three-layer tick logic (events -> health check + LLM ping -> state change notify) usage.md (en/zh): - Add /log level command to shell reference - Update memory_info tool: largest block + fragmentation Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gateway_get_stats()claw_log_set_level/get_level()with shell command/log level <error|warn|info|debug>, ESP-IDF backend syncs withesp_log_level_set()memory_infotool now reports largest contiguous free block and fragmentation percentagecheck_device_health()samples heap usage each ping cycle, auto-posts warning event when usage exceeds 80%, triggering AI summary on next tickTest plan
meson compilepasses on vexpress-a9 (zero warnings)make build-esp32c3-qemupasses (zero warnings)scripts/check-patch.sh --stagedpasses on all commitsmake run-esp32c3-qemu— AI boot test passed🦞 Generated with Claude Code